var right=document.querySelector('.right-btn');
var left=document.querySelector('.left-btn')
var picture=document.querySelectorAll('.picture')
var point=document.querySelectorAll('.point')
var index=0
function onclick1() {
    for (var i=0;i<picture.length;i++){
        picture[i].classList.remove('action')
        point[i].classList.remove('action')
    }
    index=0
    picture[0].classList.add('action')
    point[0].classList.add('action')
}
function onclick2() {
    for (var i=0;i<picture.length;i++){
        picture[i].classList.remove('action')
        point[i].classList.remove('action')
    }
    index=1
    picture[1].classList.add('action')
    point[1].classList.add('action')
}
function onclick3() {
    for (var i=0;i<picture.length;i++){
        picture[i].classList.remove('action')
        point[i].classList.remove('action')
    }
    index=2
    picture[2].classList.add('action')
    point[2].classList.add('action')
}
function onclick4() {
    for (var i=0;i<picture.length;i++){
        picture[i].classList.remove('action')
        point[i].classList.remove('action')
    }
    index=3
    picture[3].classList.add('action')
    point[3].classList.add('action')
}
right.onclick=function goRight (){
    picture[index].classList.remove('action')
    point[index].classList.remove('action')
    index++;
    picture[index].classList.add('action')
    point[index].classList.add('action')
    if (index===4){
        picture[index].classList.remove('action')
        point[index].classList.remove('action')
        index=0;
        picture[index].classList.add('action')
        point[index].classList.add('action')
    }

}
left.onclick=function goLeft (){
    if(index==0){
        point[index].classList.remove('action')
        picture[index].classList.remove('action')
        index=4
        picture[index].classList.add('action')
        point[index].classList.add('action')
    }
    point[index].classList.remove('action')
    picture[index].classList.remove('action')
    index--;
    picture[index].classList.add('action')
    point[index].classList.add('action')
}